package com.whpost.api.controller.wx;


import cn.dev33.satoken.annotation.SaCheckLogin;
import com.whpost.api.utils.ApiUtils;
import com.whpost.service.entity.tools.ResultInfo;
import com.whpost.service.service.t.IndexServices;
import com.whpost.service.service.t.TApiNonceService;
import com.whpost.service.wx.service.WxTApiNonceService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.io.UnsupportedEncodingException;
import java.text.ParseException;
import java.util.Map;
@RestController
@RequestMapping("/wx/api")
public class WxApiIndexController {

    @Resource
    private WxTApiNonceService wxTApiNonceService;


    /**
     * 获取nonce
     * @param map
     * @return
     */
    @RequestMapping("/getnonce")
    @ResponseBody
    public ResultInfo getNonce(@RequestBody Map<String, Object> map){
        String loginId = ApiUtils.getLoginId();
        return wxTApiNonceService.getNonce(loginId,map);
    }

}
